<template>
  <el-dialog
      v-model="dialogVisible"
      width="720"
  >
    <template #header>
      <div class="my-header">
        信息展示
      </div>
    </template>
    <div class="personDetail">
      <div class="personDetail-title">
        <div class="personDetail-title-li" :class="{action:navIndex===index,action1:navIndex===index&&navIndex==1}"
             @click="changeNav(index)" v-for="(item,index) in navData"
             :key="index">{{ item.lable }}
        </div>
      </div>
      <div style="padding: 0 10px 10px" v-if="navIndex==0">
        <div>
          <div style="position: relative">
            <el-divider content-position="left">
              <div class="base-info">基本信息</div>
            </el-divider>
            <div class="tips-pic-box" @click="hiddenRow(1)">
              <img class="tips-pic" :src="show1?tipsUp:tipsDown">
            </div>
          </div>
          <div class="content-box" v-if="show1">
            <ul class="content-box-left" :class="{'content-box-left3':!show2}">
              <li>
                <div>姓名：</div>
                <div class="name">{{ formData.name }}</div>
              </li>
              <li>
                <div>性别：</div>
                <div class="name1">{{ formData.gender }}</div>
              </li>
              <li>
                <div>民族：</div>
                <div class="name1">{{ formData.nation }}</div>
              </li>
              <li>
                <div>出生日期：</div>
                <div class="name1">{{ formData.birthDay}}</div>
              </li>
              <li>
                <div>身份证号：</div>
                <div class="name1">{{ formData.idCardNo }}</div>
              </li>
            </ul>
            <div class="photo">
              <h5>医生照片</h5>
              <div class="pic-3">
                <img class="pic1" :src="formData.avatar" alt="医生照片">
              </div>
            </div>
          </div>
        </div>
        <div>
          <div style="position: relative">
            <el-divider content-position="left">
              <div class="base-info">职业信息</div>
            </el-divider>
            <div class="tips-pic-box" @click="hiddenRow(2)">
              <img class="tips-pic" :src="show2?tipsUp:tipsDown">
            </div>
          </div>
          <div class="content-box" v-if="show2">
            <div style="width: 100%">
              <ul class="content-box-left">
                <li>
                  <div class="name-label">执业机构地址：</div>
                  <div class="name2">{{ formData.orgAddress}}</div>
                </li>
                <li>
                  <div class="name-label">主要执业机构：</div>
                  <div class="name2">{{ formData.orgName }}</div>
                </li>
              </ul>
              <ul class="content-box-left content-box-left1">
                <li>
                  <div class="name-label">医师级别：</div>
                  <div class="name2">{{ formData.doctorLevel }}</div>
                </li>
                <li>
                  <div class="name-label">执业范围：</div>
                  <div class="name2">{{ formData.doctorScope }}</div>
                </li>
                <li>
                  <div class="name-label">医师类别：</div>
                  <div class="name2">{{ formData.doctorType }}</div>
                </li>
                <li>
                  <div class="name-label">毕业院校：</div>
                  <div class="name2">{{ formData.school }}</div>
                </li>
                <li>
                  <div class="name-label">任职资格：</div>
                  <div class="name2">{{ formData.postQualification }}</div>
                </li>
                <li>
                  <div class="name-label">专业：</div>
                  <div class="name2">{{ formData.profession}}</div>
                </li>
                <li>
                  <div class="name-label">资格证书编码：</div>
                  <div class="name2">{{ formData.certNo }}</div>
                </li>
                <li>
                  <div class="name-label">学历：</div>
                  <div class="name2">{{ formData.education }}</div>
                </li>
                <li>
                  <div class="name-label">执业证书编码：</div>
                  <div class="name2">{{ formData.licenseNo }} </div>
                </li>
                <li>
                  <div class="name-label">审批日期：</div>
                  <div class="name2">{{ formData.approvalDate }} </div>
                </li>
                <li>
                  <div class="name-label">审批机关：</div>
                  <div class="name2">{{ formData.approvalAgency }}</div>
                </li>
              </ul>
            </div>
          </div>
        </div>
      </div>
      <div v-else style="padding: 0 10px;">
        <div>
          <div style="position: relative">
            <el-divider content-position="left">
              <div class="base-info">该医师请求变更的内容</div>
            </el-divider>
            <div class="tips-pic-box" @click="hiddenRow(3)">
              <img class="tips-pic" :src="show3?tipsUp:tipsDown">
            </div>
          </div>
          <div class="content-box" style="min-height: 576px " v-if="show3">
            <ul class="content-box-left content-box-left2">
              <li>
                <div>毕业学校请求变更为：</div>
              </li>
              <li>
                <div>任职资格请求变更为：</div>
              </li>
              <li>
                <div>学历请求变更为：</div>
              </li>
            </ul>
            <div class="photo photo-1">
              <h5>医师上传的个人照片</h5>
              <div class="pic-3 pic-4">
                照片
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <template #footer>

    </template>
  </el-dialog>
</template>

<script lang="js" setup>
import {ref} from "vue";
import tipsUp from '../../../assets/tips-up.png'
import tipsDown from '../../../assets/tips-down.png'

let dialogVisible = ref(false)
let show1 = ref(true)
let show2 = ref(true)
let show3 = ref(true)
let navIndex = ref(0)
let navData = ref([
      {
        lable: '执业信息',
      },
      {
        lable: '请求更正内容',
      }
    ]
)
// 导航栏切换
const changeNav = (index) => {
  navIndex.value = index
}
// 隐藏
const hiddenRow = (type) => {
  if (type == 2) {
    show2.value = !show2.value
  }
  if (type == 1) {
    show1.value = !show1.value
  }
  if (type == 3) {
    show3.value = !show3.value
  }
}

let formData = ref({})

const openInit = (row) => {
  formData.value = row
  dialogVisible.value = true
}
defineExpose({openInit})

</script>

<style scoped lang="scss">
.my-header {
  background: url("../../../assets/18.png") no-repeat left center;
  background-size: contain;
  padding-left: 20px;
}

.personDetail {
  border-left: 1px solid #dcdfe6;
  border-right: 1px solid #dcdfe6;
  border-bottom: 1px solid #dcdfe6;
  //padding: 10px;
  padding-top: 0;
  padding-bottom: 10px;

  .personDetail-title {
    border-bottom: 1px solid #dcdfe6;
    display: flex;
    font-size: 13px;

    .personDetail-title-li {
      padding: 5px 15px;
      cursor: pointer;
      position: relative;
      top: 1px;
      z-index: 1;
    }
  }
}


.base-info {
  font-size: 13px;
}

.content-box {
  display: flex;
  padding: 20px 10px 10px;
  border: solid 1px #dcdfe6;
  border-top: 0;

}

.content-box-left {
  flex: 1;

  li {
    padding-bottom: 10px;
    border-bottom: solid 1px #d2cbcb;
    display: flex;
    align-items: center;
    padding-top: 10px;
    font-size: 14px;

    &:nth-child(1) {
      padding-top: 0;
    }

    &:last-child {
      padding-bottom: 0;
      border-bottom: 0;
    }

    .name {
      font-size: 20px;
      color: #1b0ec5;
      margin-left: 30px;
    }

    .name1 {
      font-size: 14px;
      color: #1b0ec5;
      margin-left: 30px;
    }

    .name-label {
      width: 100px;
    }

    .name2 {
      font-size: 14px;
      color: #1b0ec5;
      margin-left: 10px;
    }
  }
}

:deep(.el-divider) {
  margin-bottom: 0;
}

.content-box-left1 {
  display: flex;
  border-top: solid 1px #d2cbcb;
  margin-top: 10px;
  flex-wrap: wrap;

  li {
    width: 49.8%;

    &:nth-child(even) {
      border-left: solid 1px #d2cbcb;
      padding-left: 5px;
      box-sizing: border-box;
    }

    &:first-child {
      padding-top: 10px;
    }

    &:last-child {
      border-bottom: solid 1px #d2cbcb;
      padding-bottom: 10px;
      width: 100%;
    }
  }
}

.content-box-left2 {
  li {
    padding-bottom: 40px;

    &:last-child {
      padding-bottom: 40px;
      border-bottom: solid 1px #d2cbcb;
    }
  }
}

.content-box-left3 {
  li {
    padding-bottom: 40px;

    &:last-child {
      padding-bottom: 40px;

    }
  }
}

.action {
  border-top: solid 1px #d2cbcb;
  //border-left: solid 1px #d2cbcb;
  border-right: solid 1px #d2cbcb;
  background: #f0f0f0;
  color: #333333;
  font-weight: bold;
}

.action1 {
  border-left: solid 1px #d2cbcb
}

.photo {
  width: 180px;
  margin-left: 10px;

  h5 {
    font-weight: normal;
    margin-bottom: 5px;
  }
}

.pic-3 {
  border: solid 1px #d2cbcb;
  height: 80%;
  background: #fff;
  display: flex;
  justify-content: center;

  .pic1 {
    width: 100%;
  }
}

.photo-1 {
  width: 320px;
}

.tips-pic {
  height: 12px;
}

.tips-pic-box {
  position: absolute;
  right: 35px;
  top: -12px;
  z-index: 3;
  background: #f0f0f0;
  padding: 0 3px;
  cursor: pointer;
}

.pic-4 {
  height: 96%;
  align-items: center;
}

</style>
<style>
.el-dialog {
  background: #f0f0f0 !important;

}

.el-tabs__content {
  display: none;
}
</style>
